Integrand size = 28, antiderivative size = 106 \[ \int \frac {(a+i a \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=-\frac {a^2 c (c+i d) x}{(c-i d) d^2}+\frac {a^2 (c+2 i d) x}{d^2}+\frac {a^2 \log (\cos (e+f x))}{d f}-\frac {a^2 (i c-d) \log (c \cos (e+f x)+d \sin (e+f x))}{d (i c+d) f} \]
-a^2*c*(c+I*d)*x/(c-I*d)/d^2+a^2*(c+2*I*d)*x/d^2+a^2*ln(cos(f*x+e))/d/f-a^ 2*(I*c-d)*ln(c*cos(f*x+e)+d*sin(f*x+e))/d/(I*c+d)/f
Time = 1.19 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.56 \[ \int \frac {(a+i a \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {i a^2 (2 d \log (i+\tan (e+f x))+i (c+i d) \log (c+d \tan (e+f x)))}{(c-i d) d f} \]
Time = 0.50 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.91, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3042, 4024, 3042, 3956, 3965, 3042, 4013}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(a+i a \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+i a \tan (e+f x))^2}{c+d \tan (e+f x)}dx\) |
\(\Big \downarrow \) 4024 |
\(\displaystyle \frac {a^2 (-d+i c)^2 \int \frac {1}{c+d \tan (e+f x)}dx}{d^2}-\frac {a^2 \int \tan (e+f x)dx}{d}+\frac {a^2 x (c+2 i d)}{d^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a^2 (-d+i c)^2 \int \frac {1}{c+d \tan (e+f x)}dx}{d^2}-\frac {a^2 \int \tan (e+f x)dx}{d}+\frac {a^2 x (c+2 i d)}{d^2}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle \frac {a^2 (-d+i c)^2 \int \frac {1}{c+d \tan (e+f x)}dx}{d^2}+\frac {a^2 x (c+2 i d)}{d^2}+\frac {a^2 \log (\cos (e+f x))}{d f}\) |
\(\Big \downarrow \) 3965 |
\(\displaystyle \frac {a^2 (-d+i c)^2 \left (\frac {d \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}+\frac {c x}{c^2+d^2}\right )}{d^2}+\frac {a^2 x (c+2 i d)}{d^2}+\frac {a^2 \log (\cos (e+f x))}{d f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a^2 (-d+i c)^2 \left (\frac {d \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}+\frac {c x}{c^2+d^2}\right )}{d^2}+\frac {a^2 x (c+2 i d)}{d^2}+\frac {a^2 \log (\cos (e+f x))}{d f}\) |
\(\Big \downarrow \) 4013 |
\(\displaystyle \frac {a^2 (-d+i c)^2 \left (\frac {d \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )}+\frac {c x}{c^2+d^2}\right )}{d^2}+\frac {a^2 x (c+2 i d)}{d^2}+\frac {a^2 \log (\cos (e+f x))}{d f}\) |
(a^2*(c + (2*I)*d)*x)/d^2 + (a^2*Log[Cos[e + f*x]])/(d*f) + (a^2*(I*c - d) ^2*((c*x)/(c^2 + d^2) + (d*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((c^2 + d ^2)*f)))/d^2
3.11.84.3.1 Defintions of rubi rules used
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[a*(x/(a^ 2 + b^2)), x] + Simp[b/(a^2 + b^2) Int[(b - a*Tan[c + d*x])/(a + b*Tan[c + d*x]), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* (x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si n[e + f*x], x]], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2/((a_.) + (b_.)*tan[(e_.) + (f _.)*(x_)]), x_Symbol] :> Simp[d*(2*b*c - a*d)*(x/b^2), x] + (Simp[d^2/b I nt[Tan[e + f*x], x], x] + Simp[(b*c - a*d)^2/b^2 Int[1/(a + b*Tan[e + f*x ]), x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0]
Time = 0.33 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.79
method | result | size |
norman | \(\frac {2 a^{2} x}{-i d +c}+\frac {i a^{2} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f \left (-i d +c \right )}-\frac {\left (i a^{2} d +a^{2} c \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{d f \left (-i d +c \right )}\) | \(84\) |
derivativedivides | \(\frac {a^{2} \left (\frac {\frac {\left (2 i c -2 d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (2 i d +2 c \right ) \arctan \left (\tan \left (f x +e \right )\right )}{c^{2}+d^{2}}+\frac {\left (-2 i c d -c^{2}+d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right ) d}\right )}{f}\) | \(95\) |
default | \(\frac {a^{2} \left (\frac {\frac {\left (2 i c -2 d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (2 i d +2 c \right ) \arctan \left (\tan \left (f x +e \right )\right )}{c^{2}+d^{2}}+\frac {\left (-2 i c d -c^{2}+d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right ) d}\right )}{f}\) | \(95\) |
parallelrisch | \(\frac {2 i x \,a^{2} d^{2} f +i \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{2} c d -2 i \ln \left (c +d \tan \left (f x +e \right )\right ) a^{2} c d +2 x \,a^{2} c d f -\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{2} d^{2}-\ln \left (c +d \tan \left (f x +e \right )\right ) a^{2} c^{2}+\ln \left (c +d \tan \left (f x +e \right )\right ) a^{2} d^{2}}{f \left (c^{2}+d^{2}\right ) d}\) | \(132\) |
risch | \(-\frac {2 a^{2} x}{i d -c}-\frac {2 i a^{2} x}{d}-\frac {2 i a^{2} e}{d f}+\frac {2 a^{2} e}{f \left (i d -c \right )}-\frac {2 i a^{2} c x}{d \left (i d -c \right )}-\frac {2 i a^{2} c e}{d f \left (i d -c \right )}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{d f}+\frac {i a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right )}{f \left (i d -c \right )}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) c}{d f \left (i d -c \right )}\) | \(225\) |
2*a^2/(c-I*d)*x+I*a^2/f/(c-I*d)*ln(1+tan(f*x+e)^2)-(I*a^2*d+a^2*c)/d/f/(c- I*d)*ln(c+d*tan(f*x+e))
Time = 0.25 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.79 \[ \int \frac {(a+i a \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {{\left (-i \, a^{2} c + a^{2} d\right )} \log \left (\frac {{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right ) + {\left (i \, a^{2} c + a^{2} d\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{{\left (i \, c d + d^{2}\right )} f} \]
((-I*a^2*c + a^2*d)*log(((I*c + d)*e^(2*I*f*x + 2*I*e) + I*c - d)/(I*c + d )) + (I*a^2*c + a^2*d)*log(e^(2*I*f*x + 2*I*e) + 1))/((I*c*d + d^2)*f)
Time = 3.63 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.87 \[ \int \frac {(a+i a \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {a^{2} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{d f} - \frac {a^{2} \left (c + i d\right ) \log {\left (e^{2 i f x} + \frac {\left (a^{2} c + i a^{2} d + \frac {i a^{2} d \left (c + i d\right )}{c - i d}\right ) e^{- 2 i e}}{a^{2} c} \right )}}{d f \left (c - i d\right )} \]
a**2*log(exp(2*I*f*x) + exp(-2*I*e))/(d*f) - a**2*(c + I*d)*log(exp(2*I*f* x) + (a**2*c + I*a**2*d + I*a**2*d*(c + I*d)/(c - I*d))*exp(-2*I*e)/(a**2* c))/(d*f*(c - I*d))
Time = 0.53 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.08 \[ \int \frac {(a+i a \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {\frac {2 \, {\left (a^{2} c + i \, a^{2} d\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} - \frac {{\left (a^{2} c^{2} + 2 i \, a^{2} c d - a^{2} d^{2}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{2} d + d^{3}} - \frac {{\left (-i \, a^{2} c + a^{2} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}}}{f} \]
(2*(a^2*c + I*a^2*d)*(f*x + e)/(c^2 + d^2) - (a^2*c^2 + 2*I*a^2*c*d - a^2* d^2)*log(d*tan(f*x + e) + c)/(c^2*d + d^3) - (-I*a^2*c + a^2*d)*log(tan(f* x + e)^2 + 1)/(c^2 + d^2))/f
Time = 0.46 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.15 \[ \int \frac {(a+i a \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {\frac {a^{2} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{d} + \frac {4 i \, a^{2} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}{c - i \, d} + \frac {a^{2} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{d} - \frac {{\left (a^{2} c + i \, a^{2} d\right )} \log \left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 \, d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - c\right )}{c d - i \, d^{2}}}{f} \]
(a^2*log(tan(1/2*f*x + 1/2*e) + 1)/d + 4*I*a^2*log(tan(1/2*f*x + 1/2*e) + I)/(c - I*d) + a^2*log(tan(1/2*f*x + 1/2*e) - 1)/d - (a^2*c + I*a^2*d)*log (c*tan(1/2*f*x + 1/2*e)^2 - 2*d*tan(1/2*f*x + 1/2*e) - c)/(c*d - I*d^2))/f
Time = 6.19 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.60 \[ \int \frac {(a+i a \tan (e+f x))^2}{c+d \tan (e+f x)} \, dx=\frac {a^2\,\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,2{}\mathrm {i}}{f\,\left (c-d\,1{}\mathrm {i}\right )}-\frac {a^2\,\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (c+d\,1{}\mathrm {i}\right )}{d\,f\,\left (c-d\,1{}\mathrm {i}\right )} \]